package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"wh-1-backend/internal/model/entity"
)

type DictionaryTypeListReq struct {
	g.Meta `path:"/dictionary/type" tags:"Dictionary" method:"get" summary:"字典类列表"`
}
type DictionaryTypeRes struct {
	List []*entity.Dictionary `json:"list"`
}

type CreateDicTypeReq struct {
	g.Meta `path:"/dictionary/type" tags:"Dictionary" method:"post" summary:"字典类"`
	Value  string `json:"value" v:"required|length:2,20"`
	Code   string `json:"code" v:"required|length:2,20"`
}

type DelDicTypeReq struct {
	g.Meta `path:"/dictionary/type/{Id}" tags:"Dictionary" method:"delete" summary:"字典类"`
	Id     uint `json:"id" in:"path" v:"required"`
}

type DictionaryListReq struct {
	g.Meta `path:"/dictionary/{Type}/items" tags:"Dictionary" method:"get" summary:"字典列表"`
	Type   string `json:"type" in:"path" v:"required"`
}

type DictionaryListRes struct {
	List []*entity.DictionaryItem `json:"list"`
}

type DictionaryItemListReq struct {
	g.Meta `path:"/dictionary/{Type}/item" tags:"Dictionary" method:"get" summary:"字典列表"`
	Type   string `json:"type" in:"path" v:"required"`
	PageCommonReq
}

type DictionaryItemListRes struct {
	Total int                      `json:"total"`
	List  []*entity.DictionaryItem `json:"list"`
}

type CreateDicReq struct {
	g.Meta `path:"/dictionary/item" tags:"Dictionary" method:"post" summary:"字典"`
	Type   string `json:"type" in:"path" v:"required"`
	Code   string `json:"code" v:"required|length:2,20"`
	Value  string `json:"value" v:"required|length:2,20"`
}

type ModifyDicReq struct {
	g.Meta `path:"/dictionary/item/{Id}" tags:"Dictionary" method:"put" summary:"字典"`
	Id     uint   `json:"id" in:"path" v:"required"`
	Code   string `json:"code" v:"required|length:2,20"`
	Value  string `json:"value" v:"required|length:2,20"`
}

type DeleteDicReq struct {
	g.Meta `path:"/dictionary/item/{Id}" tags:"Dictionary" method:"delete" summary:"字典"`
	Id     uint `json:"id" in:"path" v:"required"`
}
